package com.netease.nim.uikit.session.actions;

import android.content.Context;
import android.content.Intent;

import com.netease.nim.uikit.session.constant.RequestCode;
import com.netease.nimlib.sdk.msg.MessageBuilder;
import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.netease.nim.uikit.R;
import java.io.File;

/**
 * Created by hzxuwen on 2015/6/12.
 */
public class ImageAction extends PickImageAction {

    public ImageAction(ImageBasePresenter presenter,int code) {
        super(code == RequestCode.PICTURE ? R.drawable.nim_message_plus_photo_selector : R.drawable.nim_message_plus_video_selector,
                code == RequestCode.PICTURE ? R.string.picture : R.string.takepicture, true, code, presenter);
    }

    @Override
    protected void onPicked(File file) {
        IMMessage message = MessageBuilder.createImageMessage(getAccount(), getSessionType(), file, file.getName());
        sendMessage(message);
    }


}

